package tech.aistar.service.editnotes.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.authordis.NoteAuthor;
import tech.aistar.mapper.EditNotesMapper;
import tech.aistar.service.editnotes.IEditNotesService;

/**
 * Created by Dell on 2019/10/6.
 */
@Service
@Transactional
public class EditNotesServiceImpl implements IEditNotesService{

    @Autowired
    private EditNotesMapper editNotesMapper;
    @Override
    public NoteAuthor findNoteAuthor(Integer user_id) {

        NoteAuthor noteAuthor = editNotesMapper.findNoteAuthor(user_id);
        return noteAuthor;
    }

    @Override
    public void saveNotes(Integer autuor_id,String title,Integer note_type ,String publish_time,String front_img) {
        editNotesMapper.saveNotes(autuor_id,title,note_type,publish_time,front_img);

    }

    @Override
    public Integer findNotesId(String title, String publish_time) {
        Integer notes_id = editNotesMapper.findNotesId(title,publish_time);
        return notes_id;
    }

    /**
     * @Description:保存文章内容
     * @param:
     * @author XiaoDi
     * @date 2019/10/9 15:19
     */
    @Override
    public void saveNotesInfo(Integer notes_id, Integer page_id, String photo, String content) {
        editNotesMapper.saveNotesInfo(notes_id,page_id,photo,content);
    }

}
